package com.example.linxilite.nav

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.example.linxilite.screen.ChatScreen
import com.example.linxilite.screen.HomeScreen
import com.example.linxilite.screen.LoginScreen
import com.example.linxilite.screen.MatchScreen

@Composable
fun AppNavHost(modifier: Modifier){
    val navController = rememberNavController()


    NavHost(navController = navController, startDestination = "login",modifier = modifier) {
        composable("login"){ LoginScreen(navController) }
        composable("home"){ HomeScreen(navController) }
        composable("match"){ MatchScreen(navController) }
        composable("chat/{username}") { backStackEntry ->
            val username = backStackEntry.arguments?.getString("username")
            ChatScreen(username,navController)
        }

    }
}